<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>7.创建数组长度为100且元素为数组长度加下标</title>
</head>
<body>
    <!-- 创建一个数组长度为100且元素为数组长度加下标 -->
</body>
<script>
    let l = 100

    // 方法 1
    let arr = new Array(l)
    for(let i = 0; i< arr.length; i++){
        arr[i] = arr.length + i
    }
    console.log(arr)

    // 方法 2 
    let arr2 = Array.from({length: l}, (v, i) => l + i)
    console.log(arr2)

    // 方法 3
    let arr3 = Array.from(new Array(l), (v, i) => l + i)
    console.log(arr3)

    let str = 'hello tuture'
    console.log('hello tuture' instanceof String, str.__proto__, String.prototype)

    for(var i=0; i<5;i++){
        setTimeout(()=>{
            console.log('i',i)
        })
    }

</script>
</html>